﻿<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
	<meta name="language" content="en" />

	<!-- blueprint CSS framework -->
	<link rel="stylesheet" type="text/css" href="<?php echo Yii::app()->request->baseUrl; ?>/css/screen.css" media="screen, projection" />
	<link rel="stylesheet" type="text/css" href="<?php echo Yii::app()->request->baseUrl; ?>/css/print.css" media="print" />
	<!--[if lt IE 8]>
	<link rel="stylesheet" type="text/css" href="<?php echo Yii::app()->request->baseUrl; ?>/css/ie.css" media="screen, projection" />
	<![endif]-->

	<link rel="stylesheet" type="text/css" href="<?php echo Yii::app()->request->baseUrl; ?>/css/main.css" />
	<link rel="stylesheet" type="text/css" href="<?php echo Yii::app()->request->baseUrl; ?>/css/form.css" />

	<title>Kreativ</title>
</head>

<body background="graphic.jpg" text="#FFFFFF" bgcolor="#0436436">
<div>
<br><br><br><br><br>  <!-- design comes here -->
</div>
<div class="container" id="page">

	<div><!-- mainmenu -->
		<?php 
		$uid = Yii::app()->user->getId();
		$this->widget('bootstrap.widgets.TbNavbar', array(
		'type'=>'null', // null or 'inverse'
		'brand'=>'Kreatív',
		'brandUrl'=>'index.php',
		'collapse'=>true, // requires bootstrap-responsive.css
		'items'=>array(
			array(
				'class'=>'bootstrap.widgets.TbMenu',
				'items'=>array(
				),
			),
			
			array(
				'class'=>'bootstrap.widgets.TbMenu',
				'htmlOptions'=>array('class'=>'pull-right'),
				'items'=>array(
					array('label'=>'Olvasatlan: '.Yii::app()->getModule('message')->getCountUnreadedMessages(Yii::app()->user->getId()) , 'url'=>array('/message/inbox')),
					'---',
					array('label'=>'Profil', 'url'=>'#', 'items'=>array(
						array('url'=>Yii::app()->getModule('user')->loginUrl, 'label'=>Yii::app()->getModule('user')->t("Login"), 'visible'=>Yii::app()->user->isGuest),
						array('url'=>Yii::app()->getModule('user')->registrationUrl, 'label'=>Yii::app()->getModule('user')->t("Register"), 'visible'=>Yii::app()->user->isGuest),
						array('label'=>'Profile', 'url'=>"index.php?r=user/user/view&id=$uid", 'visible'=>!Yii::app()->user->isGuest),
						array('url'=>Yii::app()->getModule('user')->logoutUrl, 'label'=>Yii::app()->getModule('user')->t("Logout").' ('.Yii::app()->user->name.')', 'visible'=>!Yii::app()->user->isGuest),
				
					)),
						array('label'=>'Admin', 'url'=>'#', 'items'=>array(
						array('label'=>'Pool', 'url'=>"index.php?r=poll", 'visible'=>!Yii::app()->user->isGuest),
						array('label'=>'New Pool', 'url'=>"index.php?r=poll/poll/create", 'visible'=>!Yii::app()->user->isGuest),
						array('label'=>'Create', 'url'=>"index.php?r=Creatives/create", 'visible'=>!Yii::app()->user->isGuest),			
					)),
				),
			),
		),
	)); 
	?>
	</div>
	<table>
		<tr>
			<td>
				
			</td>
		</tr>
		<tr>
			<td width=140px align="left" valign="top">
				<?php $this->widget('bootstrap.widgets.TbMenu', array(
				'type'=>'list',
				'items'=>array(
					array('label'=>'Menü'),
					array('label'=>'Kreatívok', 'icon'=>'home', 'url'=>'index.php?r=Creatives/index'),
					array('label'=>'Praktikák', 'icon'=>'user', 'url'=>'index.php?r=Knowledge/index'),
					array('label'=>'Cserebere', 'icon'=>'cog', 'url'=>'index.php?r=Swaps/index'),
					array('label'=>'Események', 'icon'=>'pencil', 'url'=>'index.php?r=Events/indexall'),
					array('label'=>'Ajánló', 'icon'=>'cog', 'url'=>'index.php?r=Recommendations/index'),
					array('label'=>'Funkciók'),
					array('label'=>'Kedvencek', 'icon'=>'book', 'url'=>'index.php?r=Creatives/indexallfav'),
					array('label'=>'Üzenetek', 'icon'=>'flag', 'url'=> Yii::app()->getModule('message')->inboxUrl),
					array('label'=>'Információk', 'icon'=>'cog', 'url'=>'index.php?r=Creatives/AllContentsPoints'),

					//array('label'=>'Unread', 'icon'=>'flag', 'url'=> Yii::app()->getModule('message')->getCountUnreadedMessages(Yii::app()->user->getId())),
				),
				)); ?>
				<br>
				<div class = "portlet-decoration2">
					<b><font color="white">Események</font></b>
				</div>
				<div class = "portlet-content">	
				<?php
					$this->widget('ext.OPoll'); 
				?>
				</div>
				<?php $this->widget('ext.Recomm'); ?>
				<br>
				<div class = "portlet-decoration2">
					<b><font color="white">Legnépszerűbb</font></b>
				</div>
				<div class = "portlet-content">	
				<?php
					$this->widget('ext.TopCrea'); 
				?>
				</div>
			</td>
			<td>
				<?php 
				$content = preg_replace('/(<style type="text\/css">.+?)+(<\/style>)/i', '', $content);
				echo $content; 
				?>
			</td>
			<td width=140px>
				<div class = "portlet-content2">
				<?php  
				if (Yii::app()->user->name != "Guest") 
				{
				?>
				<table>
					<tr>
						<td rowspan="2">
						<img src="/files/default_crea.gif" alt="Creative" height="42" width="42">
						</td>
						<td><b>
							<?php
								echo CHtml::link(Yii::app()->user->name, array("/user/user/view&id=$uid"));
							?>
						</b></td>
					</tr>
					<tr>
						<td>
							<?php
								echo CHtml::link(Yii::app()->getModule('user')->t("Kilépés"), array("user/Logout"));
							?>
						</td>
					</tr>
					<tr><td><td></tr>
					<tr>
						<td colspan=2>
							<?php echo CHtml::link('Olvasatlan: '.Yii::app()->getModule('message')->getCountUnreadedMessages(Yii::app()->user->getId()),array('/message/inbox')); ?>
						<td>
					</tr>
					<tr>
							<td colspan=2>
							<?php echo CHtml::link("Saját oldalam", array("creatives/Private&id=".Yii::app()->user->id.""));?>
						<td>
					</tr>
				</table>
				<?php  
				}
				else 
				{
				?>
				regisztrálás/bejelentkezés
				<?php  
				}
				?>
				</div>
			
				<?php $this->widget('EPoll', array('poll_id' => 2)); ?>
				<?php $this->widget('ext.Adverts'); ?>
				<?php $this->widget('ext.RandomContent'); ?>
				hírlevél feliratkozás</br>
			</td>
	</table>	


	<div class="clear"></div>

	<div id="footer">
		Copyright &copy; <?php echo date('Y'); ?> by My Company.<br/>
		All Rights Reserved.<br/>
		<?php echo Yii::powered(); ?>
	</div><!-- footer -->

</div><!-- page -->

</body>
</html>
